package com.ruoyi.project.data.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.data.domain.DrugAllSalesRecords;
import com.ruoyi.project.data.domain.DrugSalesRecords;
import com.ruoyi.project.data.service.IDatDrugsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system/drugs")
public class DatDrugsController extends BaseController {

    @Autowired
    private IDatDrugsService iDatDrugsService;
    @PreAuthorize("@ss.hasPermi('data:drugs:list')")
    @GetMapping("/list1")
    public AjaxResult list1(DrugSalesRecords drugSalesRecords){
        List<DrugSalesRecords> list =iDatDrugsService.findDrugSalesRecords(drugSalesRecords);
        return AjaxResult.success(list);
    }
    @GetMapping("/list2")
    public AjaxResult list2(DrugAllSalesRecords drugAllSalesRecords){
        List<DrugAllSalesRecords> list =iDatDrugsService.findDrugAllSalesRecords(drugAllSalesRecords);
        return AjaxResult.success(list);
    }
}
